home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 24 / AACD 24.iso / AACD / System / ReqToolsLib / Source / reqtools / rtscreenmoderequesta.c < prev    next >
Encoding:
C/C++ Source or Header  |  2001-07-02  |  7.4 KB  |  226 lines

  1.  
  2. /*
  3.     (C) 1999 - 2000 AROS - The Amiga Research OS
  4.     $Id: rtscreenmoderequesta.c,v 1.3 2000/11/26 16:53:49 stegerg Exp $
  5.  
  6.     Desc:
  7.     Lang: English
  8. */
  9.  
  10. #include <exec/types.h>
  11. #include <proto/exec.h>
  12. #include <proto/reqtools.h>
  13. #include <proto/intuition.h>
  14. #include <exec/libraries.h>
  15. #include <exec/memory.h>
  16. #include <aros/libcall.h>
  17.  
  18. #include "reqtools_intern.h"
  19.  
  20. /*****************************************************************************
  21.  
  22.     NAME */
  23.  
  24.     AROS_LH3(ULONG, rtScreenModeRequestA,
  25.  
  26. /*  SYNOPSIS */
  27.  
  28.     AROS_LHA(struct rtScreenModeRequester *, screenmodereq, A1),
  29.     AROS_LHA(char *, title, A3),
  30.     AROS_LHA(struct TagItem *, taglist, A0),
  31.  
  32. /*  LOCATION */
  33.  
  34.     struct ReqToolsBase *, ReqToolsBase, 24, ReqTools)
  35.  
  36. /*  FUNCTION
  37.     *IMPORTANT* THIS REQUESTER IS ONLY AVAILABLE FROM KICKSTART 2.0
  38.         ONWARDS! The 1.3 version of ReqTools also contains the
  39.         screenmode requester, but unless you are running 2.0 or higher
  40.         it will not come up. So what you essentially have to do is NOT
  41.         call rtScreenModeRequestA() if your program is running on a
  42.         machine with Kickstart 1.2/1.3. You can safely call
  43.         rtScreenModeRequestA() if you are running on a 2.0 machine,
  44.         even if the user has installed the 1.3 version of ReqTools.
  45.  
  46.     Get a screen mode from the user.
  47.  
  48.     The user will be able to pick a screen mode by name, enter the size
  49.     and the number of colors (bitplane depth).
  50.  
  51.     rtScreenModeRequestA() will call the appropriate 2.0 functions to
  52.     get all the mode's information. If no name has been assigned to the
  53.     mode one will be constructed automatically.
  54.  
  55.     INPUTS
  56.     screenmodereq - pointer to a struct rtScreenModeRequester allocated
  57.         with rtAllocRequestA().
  58.     title - pointer to requester window title (null terminated).
  59.     taglist - pointer to a TagItem array.
  60.  
  61.     TAGS
  62.     RT_Window - see rtEZRequestA()
  63.  
  64.     RT_ReqPos - see rtEZRequestA()
  65.  
  66.     RT_LeftOffset - see rtEZRequestA()
  67.  
  68.     RT_TopOffset - see rtEZRequestA()
  69.  
  70.     RT_PubScrName - see rtEZRequestA()
  71.  
  72.     RT_Screen - see rtEZRequestA()
  73.  
  74.     RT_ReqHandler - see rtEZRequestA()
  75.  
  76.     RT_WaitPointer - see rtEZRequestA()
  77.  
  78.     RT_LockWindow - see rtEZRequestA()
  79.  
  80.     RT_ScreenToFront - see rtEZRequestA()
  81.  
  82.     RT_ShareIDCMP - see rtEZRequestA()
  83.  
  84.     RT_Locale - see rtEZRequestA()
  85.  
  86.     RT_IntuiMsgFunc - (struct Hook *) [V38] The requester will call
  87.         this hook for each IDCMP message it gets that doesn't belong to
  88.         its window. Only applies if you used the RT_ShareIDCMP tag to
  89.         share the IDCMP port with the parent window. Parameters are as
  90.         follows:
  91.  
  92.         A0 - (struct Hook *) your hook
  93.         A2 - (struct rtScreenModeRequester *) your req
  94.         A1 - (struct IntuiMessage *) the message
  95.  
  96.         After you have finished examining the message and your hook
  97.         returns, ReqTools will reply the message. So do not reply the
  98.         message yourself!
  99.  
  100.     RT_Underscore - (char) [V38] Indicates the symbol that precedes the
  101.         character in a gadget's label to be underscored. This will also
  102.         define the keyboard shortcut for this gadget. Currently only
  103.         needed for RTSC_OkText. Usually set to '_'.
  104.  
  105.     RT_DefaultFont - (struct TextFont *) This tag allows you to specify
  106.         the font to be used in the requester when the screen font is
  107.         proportional. Default is GfxBase->DefaultFont. This tag is
  108.         obsolete in ReqTools 2.2 and higher.
  109.  
  110.     RT_TextAttr - [V38] see rtFileRequestA()
  111.  
  112.     RTSC_Flags - (ULONG) Several flags:
  113.  
  114.         SCREQF_OVERSCANGAD - Add an overscan cycle gadget to the
  115.             requester. After the requester returns you may read the
  116.             overscan type in 'rq->OverscanType' If this is 0 no
  117.             overscan is selected (Regular Size), if non-zero it holds
  118.             one of the OSCAN_... values defined in the include file
  119.             'intuition/screens.[h|i]'.
  120.  
  121.         SCREQF_AUTOSCROLLGAD - Add an autoscroll checkbox gadget to the
  122.             requester. After the requester returns read
  123.             'smreq->AutoScroll' to see if the user prefers autoscroll
  124.             to be on or off.
  125.  
  126.         SCREQF_SIZEGADS - Add width and height gadgets to the
  127.             requester. If you do not add these gadgets the width and
  128.             height returned will be the default width and height for
  129.             the selected overscan type.
  130.  
  131.         SCREQF_DEPTHGAD - Add a depth slider gadget to the requester.
  132.             If you do not add a depth gadget, the depth returned will
  133.             be the maximum depth this mode can be opened in.
  134.  
  135.         SCREQF_NONSTDMODES - Include all modes. Unless this flag is set
  136.             rtScreenModeRequestA() will exclude nonstandard modes.
  137.             Nonstandard modes are presently HAM and EHB
  138.             (ExtraHalfBrite). So unless you are picking a mode to do
  139.             some rendering in leave this flag unset. Without this flag
  140.             set the mode returned will be a normal bitplaned mode.
  141.  
  142.         SCREQF_GUIMODES - Set this flag if you are getting a screen
  143.             mode to open a user interface screen in. The modes shown
  144.             will be standard modes with a high enough resolution
  145.             (minumum 640 pixels). If this flag is set the
  146.             SCREQF_NONSTDMODES flag is ignored.
  147.  
  148.     RTSC_Height - (ULONG) Suggested height of screenmode requester
  149.         window.
  150.  
  151.     RTSC_OkText - (char *) Replacement text for "Ok" gadget, max 6
  152.         chars long.
  153.  
  154.     RTSC_MinWidth - (UWORD) The minimum display width allowed.
  155.  
  156.     RTSC_MaxWidth - (UWORD) The maximum display width allowed.
  157.  
  158.     RTSC_MinHeight - (UWORD) The minimum display height allowed.
  159.  
  160.     RTSC_MaxHeight - (UWORD) The maximum display height allowed.
  161.  
  162.     RTSC_MinDepth - (UWORD) The minimum display depth allowed. Modes
  163.         with a minimum display depth lower than this value will not be
  164.         included in the list.
  165.  
  166.     RTSC_MaxDepth - (UWORD) The maximum display depth allowed.
  167.  
  168.     RTSC_PropertyFlags - (ULONG) A mode must have these property flags
  169.         to be included. Only bits set in RTSC_PropertyMask are
  170.         considered.
  171.  
  172.     RTSC_PropertyMask - (ULONG) Mask to apply to RTSC_PropertyFlags to
  173.         determine which bits to consider. See use of 'newsignals' and
  174.         'signalmask' in exec.library/SetSignal(). Default is to
  175.         consider all bits in RTSC_PropertyFlags as significant.
  176.  
  177.     RTSC_FilterFunc - (struct Hook *) Call this hook for each display
  178.         mode id in the system's list. Parameters are as follows:
  179.  
  180.         A0 - (struct Hook *) your hook
  181.         A2 - (struct rtScreenModeRequester *) your req
  182.         A1 - (ULONG) 32-bit extended mode id
  183.  
  184.         If your hook returns TRUE the mode will be accepted. If it
  185.         returns FALSE the mode will be skipped and will not appear in
  186.         the requester.
  187.  
  188.     RESULT
  189.     ret - FALSE if the requester was canceled or TRUE if the user
  190.         selected a screen mode (check 'smreq->DisplayID' for the 32-bit
  191.         extended display mode, 'smreq->DisplayWidth' and
  192.         'smreq->DisplayHeight' for the display size,
  193.         'smreq->DisplayDepth' for the screen's depth).
  194.  
  195.     NOTES
  196.     Automatically adjusts the requester to the screen font.
  197.  
  198.     If the requester got too big for the screen because of a very large
  199.     font, the topaz.font will be used.
  200.  
  201.     rtScreenModeRequest() checks the pr_WindowPtr of your process to
  202.     find the screen to put the requester on.
  203.  
  204.     EXAMPLE
  205.  
  206.     BUGS
  207.     none known
  208.  
  209.     SEE ALSO
  210.     graphics/GetDisplayInfoData(), graphics/displayinfo.h,
  211.     exec.library/SetSignal(), Intuition/SA_DisplayID screen tag
  212.  
  213.     INTERNALS
  214.  
  215.     HISTORY
  216.  
  217. ******************************************************************************/
  218. {
  219.     AROS_LIBFUNC_INIT
  220.  
  221.     return (ULONG)FileRequestA((struct RealFileRequester *)screenmodereq, NULL, title, taglist); /* in filereq.c */
  222.     
  223.     AROS_LIBFUNC_EXIT
  224.     
  225. } /* rtScreenModeRequestA */
  226.